import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/Manage.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component:()=>import('../views/Manage'),
    redirect:"/home",
    children:[
      {path:'home',name:'Home',component:()=>import('../views/Home')},
      {path:'yiq',name:'YiQ',component:()=>import('../views/YIQ')},
      {path:'user',name:'User',component:()=>import('../views/User')},
      {path:'Person',name:'Person',component:()=>import('../views/Person')},
      {path:'file',name:'file',component:()=>import('../views/Files')},
      {path:'role',name:'role',component:()=>import('../views/Role')},
      {path:'menu',name:'menu',component:()=>import('../views/Menu')},
      {path: '/chat', name:'chat', component:()=>import("../views/chat")},
      {path: '/notice', name:'notice', component:()=>import("../views/Notice")},
    ]
  },
  {
    path: '/login',
    name:'Login',
    component:()=>import("../views/Login")
  },
  {
    path: '/register',
    name:'Register',
    component:()=>import("../views/Register")
  },

  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
